Skip to content

Feature/speech managed identity#543

Merged
paullizer merged 7 commits into
microsoft:Developmentfrom
Xeelee33:feature/speech-managed-identity
Dec 19, 2025
Merged

Feature/speech managed identity#543
paullizer merged 7 commits into
microsoft:Developmentfrom
Xeelee33:feature/speech-managed-identity

Conversation

@Xeelee33

Copy link
Copy Markdown
Contributor

Feature - Speech-to-text functionality should now work natively in MAG and sovereign clouds
Based on the below documentation, the Fast Transcription API utilized by Simple Chat for speech-to-text transcription is not available in MAG or other sovereign clouds. For those clouds, I added conditional logic to use the Speech SDK instead.

Feature - Added Managed Identity authentication option to Speech Service Settings via drop down
Current Speech Service Settings
image

Updated Speech Service Settings
Added dropdown selection
image

API Key
image

Managed Identity
image

Managed Identity is configured to work with both the Fast Transcription API in commercial and Speech SDK in MAG and other sovereign & custom clouds.

Feature - Updated Speech Settings in Setup Walkthrough
Changed the required "Key" element to Authentication. If using Key-based auth, a Key will be required, if using Managed Identity auth, the condition will be automatically satisfied.

  • Note, additional work needed so when settings are saved the setup walkthrough doesn't start over from the beginning

Current
image

Updated
With Managed Identity selected
image

With API Key selected, but no Key entered
image

Feature/Bugfix - Setup Walkthrough Navigation
The Next and Previous buttons in the App Settings Setup Walkthrough were not working correctly. Updated the navigation settings and also updated/corrected the notes and tooltips.

Doc Updates
Rewrote docs\admin_configuration.md to be current and more comprehensive
Updated docs\setup_instructions_special.md with corrected roles needed for managed identity configuration

Xeelee33 and others added 3 commits December 10, 2025 19:33
…to the key, added MAG functionality via Azure Speech SDK since the Fast Transcription API is not available in MAG, updated Admin Setup Walkthrough so it goes to the right place in the settings when Next is clicked, updated Speech requirements in Walkthrough, rewrote Admin Configuration docs, updated/corrected Managed Identity roles in Setup Instructions Special docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds speech-to-text functionality for MAG and sovereign clouds, implements Managed Identity authentication for Azure Speech Service, fixes Setup Walkthrough navigation issues, and updates related documentation.

Key changes:

  • Adds conditional logic to use Speech SDK instead of Fast Transcription API for sovereign clouds (MAG, custom environments)
  • Implements Managed Identity authentication option with dropdown selection for Speech Service
  • Fixes Setup Walkthrough navigation to work with both tab and sidebar layouts
  • Updates role requirements in documentation for proper Managed Identity permissions

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
docs/setup_instructions_special.md Updated endpoint domain references and corrected RBAC role requirements for Managed Identity authentication (Search, Content Safety, Speech Service)
docs/admin_configuration.md Comprehensive rewrite with detailed walkthrough documentation, configuration sections, and navigation options
application/single_app/templates/admin_settings.html Added authentication type dropdown for Speech Service, updated placeholders, corrected walkthrough tab references, and added Managed Identity guidance
application/single_app/static/js/admin/admin_settings.js Enhanced walkthrough navigation to support both tab and sidebar layouts, corrected tab mappings for multimedia settings, improved scrolling behavior, and updated authentication validation logic
application/single_app/route_frontend_admin_settings.py Added speech_service_authentication_type field to form data processing
application/single_app/requirements.txt Added azure-cognitiveservices-speech SDK dependency for sovereign cloud support
application/single_app/functions_settings.py Changed default value of enable_external_healthcheck from True to False
application/single_app/functions_documents.py Implemented conditional logic for Speech SDK in sovereign clouds, added _get_speech_config helper function, and added Managed Identity support for both Fast Transcription API and Speech SDK
application/single_app/config.py Added import for Azure Cognitive Services Speech SDK

Comment thread application/single_app/templates/admin_settings.html
Comment thread application/single_app/functions_settings.py Outdated
Comment thread application/single_app/functions_documents.py Outdated
Comment thread application/single_app/functions_documents.py Outdated
Comment on lines +4831 to +4851
for idx, chunk_path in enumerate(chunk_paths, start=1):
print(f"[Debug] Transcribing chunk {idx}: {chunk_path}")

# Get fresh config (tokens expire after ~1 hour)
speech_config = _get_speech_config(settings,endpoint, locale)

audio_config = speechsdk.AudioConfig(filename=chunk_path)
speech_recognizer = speechsdk.SpeechRecognizer(
speech_config=speech_config,
audio_config=audio_config
)

result = speech_recognizer.recognize_once()
if result.reason == speechsdk.ResultReason.RecognizedSpeech:
print(f"[Debug] Recognized: {result.text}")
all_phrases.append(result.text)
elif result.reason == speechsdk.ResultReason.NoMatch:
print(f"[Warning] No speech in {chunk_path}")
elif result.reason == speechsdk.ResultReason.Canceled:
print(f"[Error] {result.cancellation_details.reason}: {result.cancellation_details.error_details}")
raise RuntimeError(f"Transcription canceled for {chunk_path}: {result.cancellation_details.error_details}")

Copilot AI Dec 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update_callback is not being called in the sovereign cloud path (SDK path). When processing audio chunks in the SDK branch, the user won't receive progress updates showing which chunk is being transcribed. Consider adding update_callback(current_file_chunk=idx, status=f"Transcribing chunk {idx}/{len(chunk_paths)}…") inside the SDK loop to maintain consistent user experience across both code paths.

Copilot uses AI. Check for mistakes.
default_settings = {
# External health check
'enable_external_healthcheck': True,
'enable_external_healthcheck': False,

Copilot AI Dec 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dictionary key 'enable_external_healthcheck' is subsequently overwritten.

Suggested change
'enable_external_healthcheck': False,

Copilot uses AI. Check for mistakes.
from io import BytesIO
from typing import List

import azure.cognitiveservices.speech as speechsdk

Copilot AI Dec 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'speechsdk' is not used.

Suggested change
import azure.cognitiveservices.speech as speechsdk

Copilot uses AI. Check for mistakes.
paullizer and others added 4 commits December 19, 2025 15:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants